﻿/************************************************************************
* Copyright (c) 2018 All Rights Reserved.
*命名空间：SERVICE.Admin.IService
*文件名： ISyetemService
*创建人： kingling
*创建时间：2018/7/6 15:28:00
*描述
*=======================================================================
*修改标记
*修改时间：2018/7/6 15:28:00
*修改人：kingling
*描述：
************************************************************************/

using MODEL.Model;
using System;
using System.Collections.Generic;
using System.Text;

namespace SERVICE.Admin.IService
{
    public interface ISyetemService
    {
        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <returns></returns>
        IList<SystemRule> GetRules();
        /// <summary>
        /// 根据角色ID 获取该角色信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        SystemRule GetRule(int id);
        /// <summary>
        /// 获取所有管理员
        /// </summary>
        /// <param name="page">当前页码从1开始</param>
        /// <param name="total">总页数</param>
        /// <param name="pageSize">每页条数</param>
        /// <returns></returns>
        IList<SystemManager> GetManagers(int page, out int total, out int pageSize);
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="name"></param>
        /// <param name="paths"></param>
        /// <returns></returns>
        bool AddRule(string name, IList<string> actionNames);
        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="paths"></param>
        /// <returns></returns>
        bool MdyRule(int id,string name, IList<string> actionNames);
        /// <summary>
        /// 添加管理员
        /// </summary>
        /// <param name="manager"></param>
        /// <returns></returns>
        SystemManager AddManager(SystemManager manager);
        /// <summary>
        /// 删除管理员
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelManager(int id);
        /// <summary>
        /// 删除角色
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelRule(int id);
        /// <summary>
        /// 修改管理员
        /// </summary>
        /// <param name="manager"></param>
        /// <returns></returns>
        SystemManager UpdateManager(SystemManager manager);
        /// <summary>
        /// 获取登录用户
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        SystemManager GetLoginManger(string key);
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="id"></param>
        /// <param name="oldPass"></param>
        /// <param name="newPass"></param>
        /// <returns></returns>
        bool UpdatePass(int id, string oldPass, string newPass);
        /// <summary>
        /// 管理员登陆
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="pass"></param>
        /// <returns></returns>
        SystemManager OnLogin(string loginName, string pass);
        /// <summary>
        /// 保存菜单
        /// </summary>
        /// <param name="systemMenus"></param>
        /// <returns></returns>
        bool SaveMenu(IList<SystemMenu> systemMenus);
        /// <summary>
        /// 获取菜单
        /// </summary>
        /// <returns></returns>
        List<SystemMenu> GetMenu();
        /// <summary>
        /// 初始化数据
        /// </summary>
        void InitData();
    }
}
